package br.com.rhweb.modelos;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "tbl_secretaria")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Secretarias implements Serializable{

	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	@Column(name = "id_secretaria")
	private int id;
	
	@Column(name = "descricao_secretaria", length = 60, nullable = true)
	private String descricao;
	
	@Column(name = "telefone_secretaria", length = 10, nullable = true)
	private String telefone;

	@Column(name = "email_secretaria", length = 30, nullable = true)
	private String email;
	
	
	@ManyToOne(optional = true,  fetch = FetchType.LAZY)
	@JoinColumn(name="cep_endereco", nullable = false)
	private Endereco endereco;
	
	@Column(name = "numero_endereco", length = 6, nullable = true)
	private String numeroEndereco;
	
	@Column(name="complemento_endereco", nullable=true)
	private String complementoEndereco;
	
	@Column(name = "cnpj_secretaria", length = 14, nullable = true)
	private String cnpj;
	
	@Column(name = "situacao", length = 1, nullable = true)
	private String situacao;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "data_inicio", nullable = true)
	private Date dataInicio;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "data_encerrameto", nullable = true)
	private Date dataEncerrameto;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getTelefone() {
		return telefone;
	}

	public void setTelefone(String telefone) {
		this.telefone = telefone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

	public String getNumeroEndereco() {
		return numeroEndereco;
	}

	public void setNumeroEndereco(String numeroEndereco) {
		this.numeroEndereco = numeroEndereco;
	}

	public String getComplementoEndereco() {
		return complementoEndereco;
	}

	public void setComplementoEndereco(String complementoEndereco) {
		this.complementoEndereco = complementoEndereco;
	}

	public String getCnpj() {
		return cnpj;
	}

	public void setCnpj(String cnpj) {
		this.cnpj = cnpj;
	}

	public String getSituacao() {
		return situacao;
	}

	public void setSituacao(String situacao) {
		this.situacao = situacao;
	}

	public Date getDataInicio() {
		return dataInicio;
	}

	public void setDataInicio(Date dataInicio) {
		this.dataInicio = dataInicio;
	}

	public Date getDataEncerrameto() {
		return dataEncerrameto;
	}

	public void setDataEncerrameto(Date dataEncerrameto) {
		this.dataEncerrameto = dataEncerrameto;
	}
	
}
